/**
 * Copyright (C), 2019-2022, 宇信融汇
 * FileName: ArraysDemo
 * Author:   666
 * Date:     2022/1/16 20:50
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 666           修改时间           版本号              描述
 */
package com.arrays;

import java.util.Arrays;

/**
 * @Classname ArraysDemo
 * @Description TODO
 * @Date 2022/1/16 20:50
 * @Created by 666
 */
public class ArraysDemo {
    public static void main(String[] args) {
        int[] arrs = {14, 22, 13, 54, 35, 16};
        //to String
        System.out.println(Arrays.toString(arrs));
        //排序    升序
        Arrays.sort(arrs);
        System.out.println(Arrays.toString(arrs));

        //二分法搜索  需要先升序排序 后二分搜索
        int i = Arrays.binarySearch(arrs, 54);
        System.out.println(i);

        String[] str = {"战士", "术士", "mogui", "yes", "不"};
        Arrays.sort(str);
        System.out.println(Arrays.toString(str));
//        int  strs= Arrays.binarySearch(arrs,);
//        System.out.println(i);
    }
}
